<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>活动管理</title>
<script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-red/easyui.css">
</head>
<body>
<script type="text/javascript">
		$(function(){
			//初始化表格
			$('#HuoDongdg').datagrid({
			    url:'',
			    /* queryParams:{
			    	deptno:10
			    }, */
			    columns:[[
					{field:'deptno',checkbox:true,title:'活动编号',width:1,align:'center'},
					{field:'dname1',title:'活动名称',width:1,align:'center'},
					{field:'loc2',title:'活动行政',width:1,align:'center'},
					{field:'loc3',title:'原因',width:1,align:'center'},
					{field:'dname4',title:'内容',width:1,align:'center'},
					{field:'loc5',title:'时间',width:1,align:'center'},
					{field:'loc6',title:'人员',width:1,align:'center'},
					{field:'loc7',title:'地点',width:1,align:'center'},
					{field:'loc8',title:'创建人',width:1,align:'center'}
			    ]],
			    toolbar:'#HuoDongtb',
			    pagination:true,
			    pageNumber:1,
			    pageSize:5,
			    pageList:[5,10,15]
			});
			
			//点击编辑按钮
			$("#HuoDongedit").click(function(){
				var c = $("#HuoDongdg").datagrid("getSelections");
				if(c==null){
					alert("请选择一行");
				}
				//console.log(c[1]["dname"]);
			});
			
			//双击行事件
			$("#HuoDongdg").datagrid({
				//rowData是当前选中行的数据，是json字符串格式
				onDblClickRow:function(rowIndex,rowData){
					$("#deptno").val(rowData["deptno"]);
					$("#dname").val(rowData["dname"])
					$("#loc").val(rowData["loc"])
					$("#HuoDongwin").window("open");
				}
			});
			
			//新增显示
			$("#HuoDongadd").click(function(){
				$("#HuoDongwin").window("open");
			});
		});
	</script>
	<div style="margin-top:15px;margin-left:15px;">
		<table id="HuoDongdg" class="easyui-datagrid"
			style="width:100%;"
	    	data-options="fitColumns:true,height:500">
		</table>
	</div>
	<div id="HuoDongtb">
		<a id="HuoDongadd" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true"></a>
		<a id="HuoDongedit" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true"></a>
	</div>
	
	<div id="HuoDongwin" class="easyui-window" title="新增活动" style="width:300px;height:200px"
    	data-options="iconCls:'icon-save',closed:true">
			<Form action="" method="post" id="HuoDongform"> 
				活动名称：<input id="" name="loc"/><br/><br/>
				活动性质：
				<select>
					<option></option>
					<option></option>
				</select>
				<br/><br/>
				原因：<input id="" name="loc"/><br/><br/>
				内容：<input id="" name="loc"/><br/><br/>
				生效时间：<input class="easyui-datetimebox" name="birthday"
    data-options="required:true,showSeconds:false" value="3/4/2010 2:3" style="width:150px"><br/>
				人员：<input id="" name="loc"/><br/><br/>
				<br/><br/>
				地点：<input id="" name="loc"/><br/><br/>
				<input type="hidden" id=""  name="deptno"/>
				<a class="easyui-linkbutton" id="" >保存</a>
			</Form>
	</div>	
</body>
</html>